import request from '@/plugin/axios'

// 获取当前用户
export const resourceList = data => {
  // return request(`/api/v1/resource?pageNum=${pageNum}&pageSize=${PAGE_SIZE}&${whereStr}`)
  return request({
    url: '/v1/resource',
    method: 'get',
    params: data
  })
}

// 创建用户
export const createResource = data => {
  return request({
    url: '/v1/resource',
    method: 'post',
    data
  })
}

// 修改用户
export const updateResource = data => {
  return request({
    url: `/v1/resource/${data.id}`,
    method: 'put',
    data
  })
}

// 删除用户
export const delResource = data => {
  return request({
    url: `/v1/resource/${data.id}`,
    method: 'delete',
    data
  })
}

// 批量删除用户
export const delAll = data => {
  return request({
    url: `/v1/resource/${data.id[0]}`,
    method: 'delete',
    data
  })
}
